'use client'

import { Button } from '@/components/ui/button'
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'

export default function TestParametersV2Page() {
  const testRoutes = [
    { path: '/hvac/parameters-v2?deviceId=1&deviceName=测试设备&tableName=table_c2&type=naming', label: '暖通 - 表 C.2' },
    { path: '/electrical/parameters-v2?deviceId=1&deviceName=测试设备&tableName=table_c2&type=naming', label: '电气 - 表 C.2' },
    { path: '/instrumentation/parameters-v2?deviceId=1&deviceName=测试设备&tableName=table_c2&type=naming', label: '仪表 - 表 C.2' },
    { path: '/communication/parameters-v2?deviceId=1&deviceName=测试设备&tableName=table_c2&type=naming', label: '通信 - 表 C.2' },
    { path: '/piping/parameters-v2?deviceId=1&deviceName=测试设备&tableName=table_c2&type=naming', label: '管道 - 表 C.2' },
  ]

  return (
    <div className="container mx-auto py-6">
      <Card>
        <CardHeader>
          <CardTitle>Parameters-v2 路由测试</CardTitle>
        </CardHeader>
        <CardContent>
          <div className="space-y-4">
            <p className="text-gray-600">点击下面的按钮测试各专业的 parameters-v2 路由是否正常工作：</p>
            
            <div className="grid grid-cols-1 gap-2">
              {testRoutes.map((route, index) => (
                <Button
                  key={index}
                  variant="outline"
                  onClick={() => {
                    console.log('测试路由:', route.path)
                    window.location.href = route.path
                  }}
                  className="justify-start"
                >
                  {route.label}
                </Button>
              ))}
            </div>
            
            <div className="mt-6 p-4 bg-gray-50 rounded-lg">
              <h3 className="font-semibold mb-2">调试信息：</h3>
              <p className="text-sm text-gray-600">
                打开浏览器开发者工具的控制台查看详细的调试信息。
              </p>
            </div>
          </div>
        </CardContent>
      </Card>
    </div>
  )
}
